﻿Public Class Form1

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        End
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        ListBox1.Items.Clear()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim i As Integer
        For i = 0 To ListBox1.Items.Count - 1
            ListBox2.Items.Add(ListBox1.Items(0))
            ListBox1.Items.RemoveAt(0)
        Next i
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim i As Integer
        For i = 0 To ListBox1.SelectedIndices.Count - 1
            ListBox2.Items.Add(ListBox1.Items(ListBox1.SelectedIndices(0)))
            ListBox1.Items.Remove(ListBox1.Items(ListBox1.SelectedIndices(0)))
        Next i
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim i As Integer
        For i = 0 To ListBox2.SelectedIndices.Count - 1
            ListBox1.Items.Add(ListBox2.Items(ListBox2.SelectedIndices(0)))
            ListBox2.Items.Remove(ListBox2.Items(ListBox2.SelectedIndices(0)))
        Next i
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        Dim i As Integer
        For i = 0 To ListBox2.Items.Count - 1
            ListBox1.Items.Add(ListBox2.SelectedIndices(0))
            ListBox2.Items.RemoveAt(0)
        Next i
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim elemento As String
        elemento = InputBox("Ingrese su nombre")
        If elemento.Trim <> "" Then
            ListBox1.Items.Add(elemento)
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim i As Integer
        For i = 0 To ListBox1.SelectedIndices.Count - 1
            ListBox1.Items.RemoveAt(ListBox1.SelectedIndices(0))
        Next i
    End Sub
End Class
